@extends('layouts.head')

@section('content')
<style>
  .avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
  .avatar-uploader .el-upload:hover {
    border-color: #20a0ff;
  }
  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 124px;
    height: 124px;
    line-height: 124px;
    text-align: center;
  }
  .avatar {
    width: 124px;
    height: 124px;
    display: block;
  }
</style>
<link rel="stylesheet" href="{{asset('bootstrap/css/bootstrap.min.css')}}">
  

<section class="content" v-cloak id="content">
<div class="box box-solid" >
  <div class="box-header with-border">
</el-input>
  </div>
  <div class="box-body " >
     
          <h3 class="profile-username text-center">@{{myCompany.name}}</h3>
          <p class="text-muted text-center">系统编码：@{{myCompany.code}}</p>
          <ul class="list-group list-group-unbordered">
            <li class="list-group-item">
              <b>公司代表</b> <a class="pull-right">@{{myCompany.contacts}}</a>
            </li>
            <li class="list-group-item">
              <b>联系方式</b> <a class="pull-right">@{{myCompany.phone}}</a>
            </li>
            <li class="list-group-item">
              <b>地址</b> <a class="pull-right">@{{myCompany.address}}</a>
            </li>
          </ul>
          <a href="#" class="btn btn-primary btn-block" @click="toEditCompany"  ><b >修改</b></a>
    </div>

<el-dialog title="修改品牌" :visible.sync="editCompanyV"   >
  
        <table  class="table ">
            <thead>   
            </thead>
            <tr>
              <td style="width: 100px" >公司代表</td>
              <td>  
                   <el-input v-model="editCompany.contacts"  placeholder="请输入内容"></el-input>
              </td>
            </tr>
            <tr>
              <td style="width: 100px" >联系方式</td>
              <td>  
                   <el-input v-model="editCompany.phone" placeholder="请输入内容"></el-input>
              </td>
            </tr>
            <tr>
              <td style="width: 100px" >公司地址</td>
              <td>  
                   <el-input v-model="editCompany.address" placeholder="请输入内容"></el-input>
              </td>
            </tr>
        </table>
  
  </el-form>
  <span slot="footer" class="dialog-footer">
    <el-button @click="editCompanyV = false">取 消</el-button>
    <el-button type="primary" @click="submitEditCompany">确 定 </el-button>
  </span>
</el-dialog>


</section>
<script >
    var content =new Vue({
        el:'#content',
        data:{
            date:'<?php echo date('Y-m-d') ?>',
            editCompanyV:false,
            company:'{{ Auth::user()->company }}',
            group:'{{ Auth::user()->group }}',
            myCompany:[],
            editCompany:{contacts:'1',phone:'2',address:'3'},

        },
        created:function(){
            this.$http.get('/company/myCompany/'+this.company).then((response) => {this.myCompany=response.data; console.log(response.data)},(response) =>{ }); 
           

        },
        computed: {
             
        },
        methods:{
               
              toEditCompany:function () {
               this.editCompany=this.myCompany;
               this.editCompanyV=true;
              } ,
              submitEditCompany:function () {
               this.editCompanyV=false;
               this.$http.post('/company/update/'+this.company,{_token :'{{csrf_token()}}',date:this.editCompany}).then((response)=>{this.$notify.info(response.data);
                             this.$http.get('/company/myCompany/'+this.company).then((response) => {this.myCompany=response.data; console.log(response.data)},(response) =>{ });       

                        },(response) =>{ });
              } ,
         },

  });
</script>




@endsection

@section('pagejs')

@endsection

        




